precision mediump float;

uniform vec3 u_color;

uniform float u_time;

varying float v_opacity;

void main() {

    float step = mod(u_time / 10., 6.);
    vec3 color1 = vec3(1.0, 1.0, 1.0); // 浅白
    vec3 color2 = vec3(0.7, 0.9, 1.0); // 浅蓝
    vec3 color3 = vec3(0.7, 1.0, 0.7); // 浅绿

    vec3 color;
    if(step < 2.0) {
        color = mix(color1, color2, step); // 从浅白到浅蓝
    } else if(step < 4.0) {
        color = mix(color2, color3, step - 2.0); // 从浅蓝到浅绿
    } else {
        color = mix(color3, color2, step - 3.0); // 从浅绿到浅白
    }

    gl_FragColor = vec4(color, v_opacity);
}